/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.user;

import java.util.Collections;
import java.util.List;

import net.groupme.model.User;
import net.groupme.utils.sql.UserQueryUtility;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * created on 14.05.2008
 * 
 * This class provides some functionality to show lists of Users.
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: mischa $
 * 
 * @version $Revision: 1.3 $ $Date: 2009-08-05 09:18:59 $
 */

public class UserListsManager {
	
	/** Logger for this class and subclasses */
	protected final Log logger = LogFactory.getLog(getClass());

	
	public UserListsManager(){
		super();
	}
	
	public List<User>getLatestUsersWithPhotos(){
		return UserQueryUtility.get6LatestUsersWithPhoto();
	}
	
	public List<User>getRandomUsersWithPhotos(){
		List<User> listOfUsers = UserQueryUtility.getAllUsersWithPhoto();
		Collections.shuffle(listOfUsers);
		return listOfUsers.subList(0, 6);
	}

}
